<template>
  <view class="pa-12 disFlxJS br-4 fz-14" style="background-color: #f2f3f5" @click.stop="toDetails">
    <text class="default-color">{{ getStatusText }}</text>
    <view class="disFlxAC" style="color: #969799">
      <text class="mx-10">详细进度</text>
      <text class="ali-icon">&#xe67b;</text>
    </view>
  </view>
</template>

<script setup lang="ts">
  import { MatchingStatusEnum } from '@/enums/businessOpportunitiesEnum';
  import { navigateTo } from '@/router';
  import { propTypes } from '@/utils/propTypes';
  import { computed, type PropType } from 'vue';

  const props = defineProps({
    id: propTypes.number,
    status: Number as PropType<MatchingStatusEnum>,
    /** 是否是审核页 */
    isAudit: propTypes.bool,
  });

  const getStatusText = computed(() => {
    switch (props.status) {
      case MatchingStatusEnum.secretariatPending:
        return '秘书处待处理';
      case MatchingStatusEnum.secretariatProcessed:
        return '秘书处已同意撮合';
      case MatchingStatusEnum.secretariatUnsuitable:
        return '秘书处已拒绝撮合';
      case MatchingStatusEnum.secretariatHold:
        return '秘书处待处理';
      case MatchingStatusEnum.brokerPending:
        return '供需服务专员待处理';
      case MatchingStatusEnum.brokerAgree:
        return '供需服务专员已同意撮合';
      case MatchingStatusEnum.brokerUnsuitable:
        return '供需服务专员已拒绝撮合';
      case MatchingStatusEnum.brokerHold:
        return '供需服务专员待处理';
      case MatchingStatusEnum.publisherPending:
        return '撮合已触达被对接者';
      case MatchingStatusEnum.publisherSuccess:
        return '被对接者对接成功';
      case MatchingStatusEnum.publisherUnsuitable:
        return '被对接者不合适';
      case MatchingStatusEnum.publisherHold:
        return '撮合已触达被对接者';
      default:
        return '';
    }
  });

  function toDetails() {
    navigateTo({
      name: 'applicationMatchingRecordDetails',
      options: { id: props.id, isAudit: props.isAudit },
    });
  }
</script>

<style scoped></style>
